package com.itheima.a05myset;

import java.util.TreeSet;

public class A06_TreeSetDemo6 {
    public static void main(String[] args) {
        //创建对象
        Student2 s1=new Student2("zhangsan",15,20,20,20);
        Student2 s2=new Student2("lisi",16,80,70,80);
        Student2 s3=new Student2("wangwu",17,40,60,80);
        Student2 s4=new Student2("zhaoliu",18,40,30,20);
        Student2 s5=new Student2("qinaqi",19,100,100,100);

        //创建集合
        TreeSet<Student2> ts=new TreeSet<>();

        //添加成员
        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.add(s4);
        ts.add(s5);

        //打印输出
        for (Student2 t : ts) {
            System.out.println(t);
        }

    }
}
